package vn.edu.uit.service.fetchers;

import org.json.JSONObject;

import vn.edu.uit.service.UITAPIContant;
import vn.edu.uit.service.UITHttpRequest;
import vn.edu.uit.service.UITHttpRequest.RequestMethod;
import vn.edu.uit.service.UITService;
import android.util.Log;

public class TestFetcher {
    private static final String LOG_TAG = "TestFetcher";
    private static UITHttpRequest httpRequest;
    
    /**
     * The method to get the district list
     * @return If success, return a district arraylist. If fail, return null.
     */
    public static void getPermisionIsPublic() {
        UITService.REQUEST_SUCCESS = false;
        httpRequest = new UITHttpRequest(UITAPIContant.API_REST_DOMAIN_URL + UITAPIContant.Api_Functions.GET_PERMISSION_IS_PUBLIC);
        httpRequest.addParam(UITService.TAG_AUTHENTICATE, UITService.TOKEN);
        try {
            JSONObject object = httpRequest.doExecute(RequestMethod.POST);
            Log.d(UITAPIContant.Api_Functions.GET_PERMISSION_IS_PUBLIC, object.toString());           
            
        } catch (Exception e) {
            // TODO Auto-generated catch block
            Log.e(LOG_TAG, e.getMessage());
        }
    }
    public static void getAccommodations() {
        UITService.REQUEST_SUCCESS = false;
        httpRequest = new UITHttpRequest(UITAPIContant.API_REST_DOMAIN_URL + UITAPIContant.Api_Functions.GET_ACCOMMODATIONS_HOTEL);
        httpRequest.addParam(UITService.TAG_AUTHENTICATE, UITService.TOKEN);
        try {
            JSONObject object = httpRequest.doExecute(RequestMethod.POST);
            Log.d(UITAPIContant.Api_Functions.GET_ACCOMMODATIONS_HOTEL, object.toString());           
            
        } catch (Exception e) {
            // TODO Auto-generated catch block
            Log.e(LOG_TAG, e.getMessage());
        }
    }
    
    public static void getSexUser() {
        UITService.REQUEST_SUCCESS = false;
        httpRequest = new UITHttpRequest(UITAPIContant.API_REST_DOMAIN_URL + UITAPIContant.Api_Functions.GET_SEX_USER);
        httpRequest.addParam(UITService.TAG_AUTHENTICATE, UITService.TOKEN);
        try {
            JSONObject object = httpRequest.doExecute(RequestMethod.POST);
            Log.d(UITAPIContant.Api_Functions.GET_SEX_USER, object.toString());           
            
        } catch (Exception e) {
            // TODO Auto-generated catch block
            Log.e(LOG_TAG, e.getMessage());
        }
    }
    
    public static void getThemesHotel() {
        UITService.REQUEST_SUCCESS = false;
        httpRequest = new UITHttpRequest(UITAPIContant.API_REST_DOMAIN_URL + UITAPIContant.Api_Functions.GET_THEMES_HOTEL);
        httpRequest.addParam(UITService.TAG_AUTHENTICATE, UITService.TOKEN);
        try {
            JSONObject object = httpRequest.doExecute(RequestMethod.POST);
            Log.d(UITAPIContant.Api_Functions.GET_THEMES_HOTEL, object.toString());           
            
        } catch (Exception e) {
            // TODO Auto-generated catch block
            Log.e(LOG_TAG, e.getMessage());
        }
    }
    
    public static void getAmenitiesHotel() {
        UITService.REQUEST_SUCCESS = false;
        httpRequest = new UITHttpRequest(UITAPIContant.API_REST_DOMAIN_URL + UITAPIContant.Api_Functions.GET_AMENITIES_HOTEL);
        httpRequest.addParam(UITService.TAG_AUTHENTICATE, UITService.TOKEN);
        try {
            JSONObject object = httpRequest.doExecute(RequestMethod.POST);
            Log.d(UITAPIContant.Api_Functions.GET_AMENITIES_HOTEL, object.toString());           
            
        } catch (Exception e) {
            // TODO Auto-generated catch block
            Log.e(LOG_TAG, e.getMessage());
        }
    }
}
